{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Examples and Exercises from Think Stats, 2nd Edition\n",
    "\n",
    "http://thinkstats2.com\n",
    "\n",
    "Copyright 2016 Allen B. Downey\n",
    "\n",
    "MIT License: https://opensource.org/licenses/MIT\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "from __future__ import print_function, division\n",
    "\n",
    "%matplotlib inline\n",
    "\n",
    "import numpy as np\n",
    "\n",
    "import nsfg\n",
    "import first\n",
    "import thinkstats2\n",
    "import thinkplot"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Examples\n",
    "\n",
    "One more time, I'll load the data from the NSFG."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "live, firsts, others = first.MakeFrames()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "And compute the distribution of birth weight for first babies and others."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Firsts 4413 4363\n",
      "Others 4735 4675\n"
     ]
    }
   ],
   "source": [
    "first_wgt = firsts.totalwgt_lb\n",
    "first_wgt_dropna = first_wgt.dropna()\n",
    "print('Firsts', len(first_wgt), len(first_wgt_dropna))\n",
    " \n",
    "other_wgt = others.totalwgt_lb\n",
    "other_wgt_dropna = other_wgt.dropna()\n",
    "print('Others', len(other_wgt), len(other_wgt_dropna))\n",
    "\n",
    "first_pmf = thinkstats2.Pmf(first_wgt_dropna, label='first')\n",
    "other_pmf = thinkstats2.Pmf(other_wgt_dropna, label='other')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can plot the PMFs on the same scale, but it is hard to see if there is a difference."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      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rKdV1K3BaehTqg8Dv0rZ8i53Pt1RyNvAFSSuBvUrmHwOskbQa+CTZuRSAw8nOtXRi1gOP/mtWI0l/ExHPp5PPvwSm5nmWhKTLgR9FxN2SbgLuiIjFfVRubqm+1oj4ab1rscZWy7FcM8vcIWlvsgf+/GMfPJDon4Aj8pdVmHUOEauF90jMzCwXnyMxM7NcHCRmZpaLg8TMzHJxkJiZWS4OEjMzy8VBYmZmufx/pOoFEALlEIcAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "width = 0.4 / 16\n",
    "\n",
    "# plot PMFs of birth weights for first babies and others\n",
    "thinkplot.PrePlot(2)\n",
    "thinkplot.Hist(first_pmf, align='right', width=width)\n",
    "thinkplot.Hist(other_pmf, align='left', width=width)\n",
    "thinkplot.Config(xlabel='Weight (pounds)', ylabel='PMF')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "`PercentileRank` computes the fraction of `scores` less than or equal to `your_score`."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "def PercentileRank(scores, your_score):\n",
    "    count = 0\n",
    "    for score in scores:\n",
    "        if score <= your_score:\n",
    "            count += 1\n",
    "\n",
    "    percentile_rank = 100.0 * count / len(scores)\n",
    "    return percentile_rank"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "If this is the list of scores."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "t = [55, 66, 77, 88, 99]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "And you got the 88, your percentile rank is 80."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "80.0"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "PercentileRank(t, 88)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "`Percentile` takes a percentile rank and computes the corresponding percentile. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "def Percentile(scores, percentile_rank):\n",
    "    scores.sort()\n",
    "    for score in scores:\n",
    "        if PercentileRank(scores, score) >= percentile_rank:\n",
    "            return score"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The median is the 50th percentile, which is 77."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "77"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Percentile(t, 50)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Here's a more efficient way to compute percentiles."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "def Percentile2(scores, percentile_rank):\n",
    "    scores.sort()\n",
    "    index = percentile_rank * (len(scores)-1) // 100\n",
    "    return scores[index]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Let's hope we get the same answer."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "77"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Percentile2(t, 50)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The Cumulative Distribution Function (CDF) is almost the same as `PercentileRank`.  The only difference is that the result is 0-1 instead of 0-100."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "def EvalCdf(sample, x):\n",
    "    count = 0.0\n",
    "    for value in sample:\n",
    "        if value <= x:\n",
    "            count += 1\n",
    "\n",
    "    prob = count / len(sample)\n",
    "    return prob"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "In this list"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [],
   "source": [
    "t = [1, 2, 2, 3, 5]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can evaluate the CDF for various values:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(0.0, 0.2, 0.6, 0.8, 0.8, 1.0)"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "EvalCdf(t, 0), EvalCdf(t, 1), EvalCdf(t, 2), EvalCdf(t, 3), EvalCdf(t, 4), EvalCdf(t, 5)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Here's an example using real data, the distribution of pregnancy length for live births."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEKCAYAAAD9xUlFAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAGdVJREFUeJzt3X+UVPWd5vH3I78HiCY0OoZGmhiMMOyg0CoCm1XHuKAGNokZNHpGRw6oE1bdSTKLOzPG1cmJSZjJ+nMTIh40G0GNMRLBwRyFjU4gQwPBCMgJSxB78QjDqsFRhHY++8e9fS2K7q6mu29Xd9XzOqcP99761q3PLct66nt/fK8iAjMzM4Djyl2AmZn1HA4FMzPLOBTMzCzjUDAzs4xDwczMMg4FMzPLOBTMzCzjUDAzs4xDwczMMn3LX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W6/BHg0jbW39q2FvpYJPeQaH6dSelYOe+T9MjqgX8P3Ejr7/mngPEkI3BCEpKvF7zG90mG0WgeEmYn8AlJ9wArgGcL2u4l+W9tvZxDwbrSexFxRuGC9MvmXwsXkfzavKKo3Zkl1l04ps0HQN90HJwLgXMj4l1Ja0h6HACHIyIK25dY/wMkv9r/EHiwRFsB34yI7xdtQ10LdQ6i5WGe23LUtrbQpknScRHxbxFxWMkIon9O8sv/JeB84FSSwfJOpeX3/N8BWyLi3Fbq+CVwvqS/j4iDEfGmpAnAfwS+DPwpcG3adiDw3jFup/VAPqZg3W0dMFXSJwEk/YGk04BXSH6F1qXtZrf89CMcD7yZBsLpJL+IS3mOZLdW881qms/eeZLkVqZnAatKrGMVcG3BfvkRSsa8b1FEvAkcUHLbTEhG+mx2ABjajrqLbQc+UTD/C+Cr6b8vkBzk/3UajK2959uB4ZLOTZf3k/RHBetcDKwEHpfUV1INcFxEPAH8LTCxoO1pJLvIrJdzKFi3ioh9JL/Il0p6ieQL6/SIeA/4C+AfJb1IMsrr2yVW948kPYaXgDvSdZVyE8mv39+Q7Hb5o7SuQyRDMT+W7lZqaxueJdkFtDZdz48p/cU+B1gkaS1Jz6F521aTHFguPNDcHitIRsRt9gJwMrA2It4ADqbL2nrPD5EMPf0tSZuBXwNTirb1H0h2R/2Q5M5ma9JdhEuAWyC7p8UngYZjqN96KI+Saj2GpCER8Y6SfU73Ab+NiO9202sfR/Ll98WI+G0O6x8S6b2VJS0ATo6Im0o8ra31nQw8HBGfKdk4Z+kxnYkR8bflrsU6zz0F60nmpr9Ct5DsGvp+ifZdQtI4YAfwXB6BkLok7Q28THIA+O86s7JI7s/7A+V08dox6gv8fbmLsK7hnoKZmWXcUzAzs4xDwczMMg4FMzPLOBTMzCzjUDAzs4xDwczMMv8fjul0/EMw4I8AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "cdf = thinkstats2.Cdf(live.prglngth, label='prglngth')\n",
    "thinkplot.Cdf(cdf)\n",
    "thinkplot.Config(xlabel='Pregnancy length (weeks)', ylabel='CDF', loc='upper left')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "`Cdf` provides `Prob`, which evaluates the CDF; that is, it computes the fraction of values less than or equal to the given value.  For example, 94% of pregnancy lengths are less than or equal to 41."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.9406427634455619"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "cdf.Prob(41)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "`Value` evaluates the inverse CDF; given a fraction, it computes the corresponding value.  For example, the median is the value that corresponds to 0.5."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "39"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "cdf.Value(0.5)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "In general, CDFs are a good way to visualize distributions.  They are not as noisy as PMFs, and if you plot several CDFs on the same axes, any differences between them are apparent."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEKCAYAAAD9xUlFAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAIABJREFUeJzt3X2UXXV97/H3Z+ZkMiQikGQqIZOYlPIUQglhCmiq0CqWiCYV9f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cl+1QgaZakys1jvgu8MZkSW41jAAABSUlEQVRbeAnFSeTRPEuxOVs1m4E/qjj25uT9D6e4IdDjFMs/5ydxHQnMSY73AguT82dTLH2N5gH2bPF5fumgpJdS3Afj/1LswrsoOS7g0ORzmQ3LScEayY8o3nW0ruLYM6VJ3mSHsy8DayX9iGK30sqL+VcptjreBPwLxbmJZ0b53P8BvKHaRDPFi/0JyYW35HHgOxR3C3tXRLxA8e6k9iSu24DlyVaJDwA/Sb6Wj7P3/EQ1l1Dc1/tB4KDU8dOAhyRtBN5Ice4B4ESKcxODmI3AXVKtJUl6UUQ8l0y8/ieweDy98CVdA/xHRNwj6Wbgzoi4o0bhjlsS36qIuDfvWKy+jaVeataM7pR0MMWNR/6xBpujfBQ4efxhZWaTE4KNhUcKZmZW5jkFMzMrc1IwM7MyJwUzMytzUjAzszInBTMzK3NSMDOzsv8PLMIN1j3eQh8AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "first_cdf = thinkstats2.Cdf(firsts.totalwgt_lb, label='first')\n",
    "other_cdf = thinkstats2.Cdf(others.totalwgt_lb, label='other')\n",
    "\n",
    "thinkplot.PrePlot(2)\n",
    "thinkplot.Cdfs([first_cdf, other_cdf])\n",
    "thinkplot.Config(xlabel='Weight (pounds)', ylabel='CDF')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "In this example, we can see that first babies are slightly, but consistently, lighter than others.\n",
    "\n",
    "We can use the CDF of birth weight to compute percentile-based statistics."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [],
   "source": [
    "weights = live.totalwgt_lb\n",
    "live_cdf = thinkstats2.Cdf(weights, label='live')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Again, the median is the 50th percentile."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "7.375"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "median = live_cdf.Percentile(50)\n",
    "median"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The interquartile range is the interval from the 25th to 75th percentile."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(6.5, 8.125)"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "iqr = (live_cdf.Percentile(25), live_cdf.Percentile(75))\n",
    "iqr"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can use the CDF to look up the percentile rank of a particular value.  For example, my second daughter was 10.2 pounds at birth, which is near the 99th percentile."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "98.82717415357381"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "live_cdf.PercentileRank(10.2)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "If we draw a random sample from the observed weights and map each weigh to its percentile rank."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [],
   "source": [
    "sample = np.random.choice(weights, 100, replace=True)\n",
    "ranks = [live_cdf.PercentileRank(x) for x in sample]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The resulting list of ranks should be approximately uniform from 0-1."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEKCAYAAAD9xUlFAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RV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k9RkKkqS+/w8pdtaRlNKD+gAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "rank_cdf = thinkstats2.Cdf(ranks)\n",
    "thinkplot.Cdf(rank_cdf)\n",
    "thinkplot.Config(xlabel='Percentile rank', ylabel='CDF')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "That observation is the basis of `Cdf.Sample`, which generates a random sample from a Cdf.  Here's an example."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEKCAYAAAD9xUlFAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAIABJREFUeJzt3Xt8VfWZ7/HPE64WoaGAVIgaWvFCRYtkuNR6xlqteDlQW1Gondo5dni13tvalrbHHrS+zrFY6+mop5bjULVVAW9jqnSwFZ32TL1FkaioM1RRY4gQhkBBLoE854+11mZls3Mh2StrX77v1ysv1157ZechJnn27/mt3/Mzd0dERASgIu0ARESkcCgpiIhIhpKCiIhkKCmIiEiGkoKIiGQoKYiISIaSgoiIZCgpiIhIhpKCiIhk9E87gAM1cuRIr66uTjsMEZGi8sILLzS7+6iuriu6pFBdXU1dXV3aYYiIFBUze7s716l8JCIiGUoKIiKSoaQgIiIZRTenkEtraysNDQ3s3Lkz7VCK2uDBg6mqqmLAgAFphyIiKSmJpNDQ0MDQoUOprq7GzNIOpyi5O5s2baKhoYFx48alHY6IpCSx8pGZLTazDWb2SgfPm5n9o5mtNbN6Mzuxp19r586djBgxQgmhF8yMESNGaLQlUuaSnFO4E5jRyfNnAuPDj3nAL3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/j9CEodnfkrQYO0A/VH4CrgaXffCIwAjgFeDd81v2Vms8NYzMxOiH+yu28G/mpm08JT3d1as9WC9ui5vEGwUVDkcNu3x/Rc4P8RlNaqzezI8PzfAf8aHq8jKAkBfLEbsfwRONfMDjKzocB/BTCzCoJy15MEGypVAgeHn3MUQdlMyoiSgqQlmoR9CVhK0MFxbxefU0/wDnt1bKK5O54lKKH8MfY69e4evXO+ELjYzFYDr5J729aLgUVm9jTBO/gt3fi6i4D6DiaaHyOYI4m8BlxkQcfXjxBsHrQT+HuC0tbLBP3wo06h1wI/N7M/EYwGOuXB1q9LCeZxHiQYPUGQjH8Tvv4q4Gbft63pZ8I4pYyoS6pIN5jZwe6+LTyeDxzq7lf24vUOBe5299Mt2I71UXc/Li/B5oGZjQbudffPph2L9C3NKYh0z9lm9n2C35m3Ce466jF3X29m/zetxWvdcDjw7bSDkL6nkYKIiGRoTkFERDKUFEREJENJQUREMpQUREQkQ0lBREQylBRERCTj/wPZw8smj9nJ6wAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "resample = live_cdf.Sample(1000)\n",
    "thinkplot.Cdf(live_cdf)\n",
    "thinkplot.Cdf(thinkstats2.Cdf(resample, label='resample'))\n",
    "thinkplot.Config(xlabel='Birth weight (pounds)', ylabel='CDF')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "This confirms that the random sample has the same distribution as the original data."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "## Exercises"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "**Exercise:** How much did you weigh at birth? If you don’t know, call your mother or someone else who knows. Using the NSFG data (all live births), compute the distribution of birth weights and use it to find your percentile rank. If you were a first baby, find your percentile rank in the distribution for first babies. Otherwise use the distribution for others. If you are in the 90th percentile or higher, call your mother back and apologize."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "85.90419436167774"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Solution\n",
    "\n",
    "first_cdf.PercentileRank(8.5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "82.35294117647058"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Solution\n",
    "\n",
    "other_cdf.PercentileRank(8.5)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "**Exercise:** The numbers generated by `numpy.random.random` are supposed to be uniform between 0 and 1; that is, every value in the range should have the same probability.\n",
    "\n",
    "Generate 1000 numbers from `numpy.random.random` and plot their PMF.  What goes wrong?\n",
    "\n",
    "Now plot the CDF. Is the distribution uniform?"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Solution\n",
    "\n",
    "t = np.random.random(1000)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZgAAAEKCAYAAAAvlUMdAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAIABJREFUeJztnXuUXdV52H/fzEhCQi9AAoQeSBhhW6DwsIxx4iaOMQXTxnIS3Ag7Dk5xSFJwnk1qr6ZuQ0NX3CzXq0kgLinE1HUMmDj2xJFNEoNr7GUeIsYIYYTHSEKDXqORNKN53efXP86Z4erqPs699+xz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TkbOAtwGPh+88Cd4S9pD+skBVgsk7Yfwb8efjNr1Z9U0kf8PawR3OFqq425WJExRSM0fOEw0+/Afx7EZlHcO3CEVUtiMhPEyigRt+fAMZE5B3hqw9W/Pyt2b9F5BKCuYzdbco5ATxNMGz11YqeyRLgYCj7B+t9X8UygjkkeP1EcICToX+z/ANwx+wfInJFG6IbPYopGMMAVPV7BHMc24DPA1tEZAdBg/1SBC9+GbhbRL4LTFe8vwfoDyfYHyI4obeTO3QeAn4x/H+W/wQ8RTDEF0VWCG5v/KKIPAEcrXj/d8DPhsu3/wWB4t0iIs+HJyv/WgeyGz2GnaZsGIZhOMF6MIZhGIYTTMEYhmEYTjAFYxiGYTjBFIxhGIbhBFMwhmEYhhNMwRiGYRhOMAVjGIZhOMEUjGEYhuGE/w+inqp/AnK+ngAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Solution\n",
    "\n",
    "pmf = thinkstats2.Pmf(t)\n",
    "thinkplot.Pmf(pmf, linewidth=0.1)\n",
    "thinkplot.Config(xlabel='Random variate', ylabel='PMF')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEKCAYAAAD9xUlFAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAIABJREFUeJzt3Xmc1uP+x/HXR0pRKhqONpMj5yAOnbEvIZysHadQCVFNluxZfoqSnSyhI0Wyl8rRcCLOsROa7GVLxNgqkkrLzPT5/XHfzbmb+3vPjJrv9577vt/Px8PDfV/XNff9+c5M876/23WZuyMiIgKwUboLEBGRukO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96b6Pook0p6CZKJGZvYekA/MAp6PtxtwnZkdCKwhNp3w1vG+L939vfjjWUB+/FN8M3d/Od7+EHBE/PH+wJ0A7v6Jmc0n9oca4EV3XwosNbMlwFPx9g+J77VUMhE4EXiR2JQq/4y3dzCza4BmxKYgmZ7wNZPcvTzgtVoDE+Pz5zcAvgwYA3AosFPCMiGbm1mTeN0iKWlPQTLRCnffDdiW2B/GtecUTgLygL/G+38kNjkaxA7trFVO7AORkXrK4aoWXUp8rTUJz9cQ/EGrCDjCzLYA/gq8EG8fDwyM741clVArwPIU730ncFf8awZU+ppEGwH7xPccdnP3VgoEqQmFgmSs+KGZc4FBZlaf2BToC9y91MwOJhYaVX39L8ASM9s/3nRSQvcra5+b2Q7Ejs1/up51LgPeJnZI5+mEPYAmwPfx2k9K9fWVNCV2TgT+N9MvwNL46631HDBw7RMz2209SpccpFCQjObu7xI7Zt8DeAQoMLNiYn9kP6nBS5wGjDKzGcCKhPZ/AvXiJ3knEpt5c0PWoJgI9I7/f60rgLeIHf6qSa0QW2Vskpm9CixKaH8KOC5+qe4BxMKyIL6w+xxiJ6JFqqVZUkVEpIL2FEREpIJCQUREKigURESkgkJBREQqKBRERKSCQkFERCooFEREpIJCQUREKvw/BG1W6VOMnqcAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Solution\n",
    "\n",
    "cdf = thinkstats2.Cdf(t)\n",
    "thinkplot.Cdf(cdf)\n",
    "thinkplot.Config(xlabel='Random variate', ylabel='CDF')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
